package project.entity;

import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

/**
 * <p>
 * 旅游景点表
 * </p>
 *
 * @author YJR
 * @since 2023-07-25
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_spots")
public class TSpots implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("c_id")
    private String cId;

    /**
     * 景点名称
     */
    @TableField("c_name")
    private String cName;

    /**
     * 标签
     */
    @TableField("c_tag")
    private String cTag;

    /**
     * 封面图
     */
    @TableField("c_cover")
    private String cCover;

    /**
     * 详情描述
     */
    @TableField("c_detail")
    private String cDetail;

    /**
     * 点赞列表
     */
    @TableField("c_prizeList")
    private String cPrizelist;

    /**
     * 点赞列表
     */
    @TableField(exist = false)
    private JSONArray prizeList;

    /**
     * 评论列表
     */
    @TableField("c_commentList")
    private String cCommentlist;

    /**
     * 评论列表
     */
    @TableField(exist = false)
    private JSONArray commentList;
    /**
     * 价格
     */
    @TableField("d_price")
    private Object dPrice;

    /**
     * 景点类型（t_jdlx.c_id）
     */
    @TableField("c_jdlx_id")
    private String cJdlxId;

    /**
     * 经度
     */
    @TableField("c_longitude")
    private String cLongitude;

    /**
     * 纬度
     */
    @TableField("c_latitude")
    private String cLatitude;

    /**
     * 位置名称
     */
    @TableField("c_address")
    private String cAddress;

    public String getcId() {
        return cId;
    }

    public void setcId(String cId) {
        this.cId = cId;
    }

    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    public String getcTag() {
        return cTag;
    }

    public void setcTag(String cTag) {
        this.cTag = cTag;
    }

    public String getcCover() {
        return cCover;
    }

    public void setcCover(String cCover) {
        this.cCover = cCover;
    }

    public String getcDetail() {
        return cDetail;
    }

    public void setcDetail(String cDetail) {
        this.cDetail = cDetail;
    }

    public String getcPrizelist() {
        return cPrizelist;
    }

    public void setcPrizelist(String cPrizelist) {
        this.cPrizelist = cPrizelist;
        if (StringUtils.isBlank(cPrizelist)) {
            this.prizeList = new JSONArray();
        } else {
            this.prizeList = JSONArray.parse(cPrizelist);
        }
    }

    public JSONArray getPrizeList() {
        return prizeList;
    }

    public void setPrizeList(JSONArray prizeList) {
        this.prizeList = prizeList;
        if (prizeList == null) {
            this.cPrizelist = new JSONArray().toJSONString();
        } else {
            this.cPrizelist = prizeList.toJSONString();
        }

    }

    public String getcCommentlist() {
        return cCommentlist;
    }

    public void setcCommentlist(String cCommentlist) {
        this.cCommentlist = cCommentlist;
        if (StringUtils.isBlank(cCommentlist)) {
            this.commentList = new JSONArray();
        } else {
            this.commentList = JSONArray.parse(cCommentlist);
        }
    }

    public JSONArray getCommentList() {
        return commentList;
    }

    public void setCommentList(JSONArray commentlist) {
        if (commentlist == null) {
            this.cCommentlist = new JSONArray().toJSONString();
        } else {
            this.cCommentlist = commentlist.toJSONString();
        }
        this.commentList = commentlist;
    }

    public Object getdPrice() {
        return dPrice;
    }

    public void setdPrice(Object dPrice) {
        this.dPrice = dPrice;
    }

    public String getcJdlxId() {
        return cJdlxId;
    }

    public void setcJdlxId(String cJdlxId) {
        this.cJdlxId = cJdlxId;
    }

    public String getcLongitude() {
        return cLongitude;
    }

    public void setcLongitude(String cLongitude) {
        this.cLongitude = cLongitude;
    }

    public String getcLatitude() {
        return cLatitude;
    }

    public void setcLatitude(String cLatitude) {
        this.cLatitude = cLatitude;
    }

    public String getcAddress() {
        return cAddress;
    }

    public void setcAddress(String cAddress) {
        this.cAddress = cAddress;
    }
}
